package cn.yh.register;

import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import com.alibaba.excel.metadata.CellData;
import com.alibaba.excel.metadata.CellExtra;
import com.alibaba.excel.read.listener.ReadListener;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

public class DemoDataListener extends AnalysisEventListener<DemoDate> {

    List<DemoDate> list = new ArrayList<>();
    // 每读取一行数据都会执行该方法
    @Override
    public void invoke(DemoDate demoDate, AnalysisContext analysisContext) {
        list.add(demoDate);
    }

    // 所有数据读取完会执行该方法
    @Override
    public void doAfterAllAnalysed(AnalysisContext analysisContext) {
        list.forEach(System.out::println);
    }
}
